﻿@model OrderDesk.Areas.OrdersManagment.Models.OrdersModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section pagescripts
{
    <script src="@Url.Resource("~/js/OrdersPending.js", "OrdersManagment")"></script>
    <script>
        var ordersPending;
        $(function () {
            ordersPending = new OrdersPending();
            ordersPending.Init();
            window.setInterval("ordersPending.getOrdersData()", 10000);
        });
    </script>
}
<h2>
    Index</h2>
<div>
    <div>
        <div>
            <h2>@Translator.Translate("on_prep_orders_title")</h2>
            <ul id="OrdersOnPrepList">
            </ul>
        </div>
        <div>
            <h2>@Translator.Translate("pending_orders_title")</h2>
            <ul id="OrdersPendingList">
            </ul>
        </div>
    </div>
    <div>
        <div>
            <h2>@Translator.Translate("finished_orders_title")</h2>
            <ul id="OrdersFinishedList">
            </ul>
        </div>
    </div>
</div>
<div style="display: none;" id="employeeSelectDlg">
    <h2>@Translator.Translate("worker_prep_title")</h2>
    @using (Html.BeginForm("PrepareOrder", "Orders", FormMethod.Post))
    { 
        <input type="hidden" id="orderId" name="orderId" />
        @Html.DropDownList("preparingEmp", Model.EmpList.Select(x => new SelectListItem { Text = x.FirstName, Value = x.EmpId.ToString() }))
        
        <input type="submit" value="@Translator.Translate("choose")" />
    }
</div>
